#ifndef WU_TIMER_H
#define WU_TIMER_H
#include <array>
#include <list>

struct timenode {};

struct timeinfo {
  std::list<timenode> nodelist;
};

class TimerWheel {
private:
  std::array<timeinfo, 256> micro_wheel;
  std::array<timeinfo, 64> second_wheel;
  std::array<timeinfo, 64> minute_wheel;

  std::array<int, 3> pin; //三个表的指针，表示当前执行的是哪个刻度的事件
  std::array<int, 3> mask;
  unsigned long long step; // 10 ms走一格
  void AdjustTimer() {
    unsigned long long masks = 256;
    int adjustlayer = 0;
    while ((step % masks) == 0) {
      int topindex = pin[adjustlayer + 1];
      for(auto p = )
    }
  }

public:
  TimerWheel() {}
  void InsertTimer(int time);
  void Run();
};
#endif
